<?php
/**
 * Created by PhpStorm.
 * User: LiuPeng
 * Date: 2018/5/14
 * Time: 10:37
 */

class AMAP {
    const API_ROOT = 'http://restapi.amap.com/v3';
    const URL_GEOCODE_REGDO = '/geocode/regeo?';

    private $key = 'c0d159e2a489c50d62477903fa2291c3';

    public function __construct($options = array()) {
        if (isset($options['key'])) $this->key = $options['key'];
    }

    public function get_domain($longitude, $latitude) {
        $city_code = $this->get_city_code(
            array(
                'longitude' => $longitude,
                'latitude' => $latitude
            )
        );

        if ($city_code) {
            $domain = $this->city_code_to_domain($city_code);
            return $domain;
        }

        return false;
    }

    private function get_city_code($option) {
        $result = $this->regeo($option);
        if ($result) {
            $arr = json_decode($result, true);
            if (isset($arr['status']) && 1 == intval($arr['status'])) {
                if (10000 == intval($arr['infocode'])) {
                    $citycode = $arr['regeocode']['addressComponent']['citycode'];
                    return $citycode;
                }
            }
        }

        return false;
    }

    public function regeo($option) { // longitude, latitude(经度在前，纬度在后，经纬度间以“,”分割)
        if (empty($option)) return false;
        $param = array('key' => $this->key);

        if (isset($option['longitude']) && isset($option['latitude'])) {
            $param['location'] = $option['longitude'] . ',' . $option['latitude'];
        } else {
            return false;
        }

        $param = http_build_query($param);
        $url = self::API_ROOT . self::URL_GEOCODE_REGDO . $param;
        $result = $this->http_get($url);

        return $result;
        /*
            {
              "status": "1",
              "info": "OK",
              "infocode": "10000",
              "regeocode": {
                "formatted_address": "湖北省武汉市武昌区东湖风景区街道东湖东湖生态旅游风景区-听涛景区",
                "addressComponent": {
                  "country": "中国",
                  "province": "湖北省",
                  "city": "武汉市",
                  "citycode": "027",
                  "district": "武昌区",
                  "adcode": "420106",
                  "township": "东湖风景区街道",
                  "towncode": "420106092000",
                  "neighborhood": {
                    "name": "东湖生态旅游风景区",
                    "type": "风景名胜;风景名胜;国家级景点"
                  },
                  "building": {
                    "name": "东湖",
                    "type": "地名地址信息;自然地名;河流"
                  },
                  "streetNumber": {
                    "street": "黄鹂路",
                    "number": "84号",
                    "location": "114.375174,30.5590669",
                    "direction": "西南",
                    "distance": "331.177"
                  },
                  "businessAreas": [
                    {
                      "location": "114.35524290267173,30.557011671755728",
                      "name": "东湖路",
                      "id": "420106"
                    },
                    {
                      "location": "114.36244166666654,30.56995549586781",
                      "name": "东亭",
                      "id": "420106"
                    }
                  ]
                }
              }
            }
        */
    }

    private function http_get($url){
        $oCurl = curl_init();
        if(stripos($url,"https://")!==FALSE){
            curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
            curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
            curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
        }
        curl_setopt($oCurl, CURLOPT_URL, $url);
        curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
        $sContent = curl_exec($oCurl);
        $aStatus = curl_getinfo($oCurl);
        curl_close($oCurl);
        if(intval($aStatus["http_code"])==200){
            return $sContent;
        }else{
            return false;
        }
    }

    public function city_code_to_domain($city_code) {
        if (array_key_exists($city_code, self::$CITY_CODE_TO_DOMAIN)) {
            return self::$CITY_CODE_TO_DOMAIN[$city_code]['domain'];
        }

        return false;
    }
    
    private static $CITY_CODE_TO_DOMAIN = array(
        '010' => array('domain' => 'bj', 'name' => '北京'),
        '021' => array('domain' => 'sh', 'name' => '上海'),
        '022' => array('domain' => 'tj', 'name' => '天津'),
        '023' => array('domain' => 'cq', 'name' => '重庆'),

        '0311' => array('domain' => 'sjz', 'name' => '石家庄'),
        '0315' => array('domain' => 'tangshan', 'name' => '唐山'),
        '0335' => array('domain' => 'qinhuangdao', 'name' => '秦皇岛'),
        '0310' => array('domain' => 'handan', 'name' => '邯郸'),
        '0319' => array('domain' => 'xingtai', 'name' => '邢台'),
        '0312' => array('domain' => 'baoding', 'name' => '保定'),
        '0313' => array('domain' => 'zhangjiakou', 'name' => '张家口'),
        '0314' => array('domain' => 'chengde', 'name' => '承德'),
        '0317' => array('domain' => 'cangzhou', 'name' => '沧州'),
        '0316' => array('domain' => 'langfang', 'name' => '廊坊'),
        '0318' => array('domain' => 'hengshui', 'name' => '衡水'),

        '020' => array('domain' => 'gz', 'name' => '广州'),
        '0755' => array('domain' => 'sz', 'name' => '深圳'),
        '0756' => array('domain' => 'zhuhai', 'name' => '珠海'),
        '0754' => array('domain' => 'shantou', 'name' => '汕头'),
        '0757' => array('domain' => 'foshan', 'name' => '佛山'),
        '0750' => array('domain' => 'jiangmen', 'name' => '江门'),
        '0668' => array('domain' => 'maoming', 'name' => '茂名'),
        '0752' => array('domain' => 'huizhou', 'name' => '惠州'),
        '0769' => array('domain' => 'dg', 'name' => '东莞'),
        '0760' => array('domain' => 'zhongshan', 'name' => '中山'),
        '0751' => array('domain' => 'shaoguan', 'name' => '韶关'),
        '0759' => array('domain' => 'zhanjiang', 'name' => '湛江'),
        '0758' => array('domain' => 'zhaoqing', 'name' => '肇庆'),
        '0753' => array('domain' => 'meizhou', 'name' => '梅州'),
        '0660' => array('domain' => 'shanwei', 'name' => '汕尾'),
        '0762' => array('domain' => 'heyuan', 'name' => '河源'),
        '0662' => array('domain' => 'yangjiang', 'name' => '阳江'),
        '0763' => array('domain' => 'qingyuan', 'name' => '清远'),
        '0768' => array('domain' => 'chaozhou', 'name' => '潮州'),
        '0663' => array('domain' => 'jieyang', 'name' => '揭阳'),
        '0766' => array('domain' => 'yunfu', 'name' => '云浮'),

        '0571' => array('domain' => 'hz', 'name' => '杭州'),
        '0574' => array('domain' => 'nb', 'name' => '宁波'),
        '0577' => array('domain' => 'wenzhou', 'name' => '温州'),
        '0573' => array('domain' => 'jiaxing', 'name' => '嘉兴'),
        '0572' => array('domain' => 'huzhou', 'name' => '湖州'),
        '0575' => array('domain' => 'shaoxing', 'name' => '绍兴'),
        '0579' => array('domain' => 'jinhua', 'name' => '金华'),
        '0570' => array('domain' => 'quzhou', 'name' => '衢州'),
        '0580' => array('domain' => 'zhoushan', 'name' => '舟山'),
        '0576' => array('domain' => 'zjtaizhou', 'name' => '台州'),
        '0578' => array('domain' => 'lishui', 'name' => '丽水'),
        '0574' => array('domain' => 'cixi', 'name' => '慈溪'),
        '0579' => array('domain' => 'yiwu', 'name' => '义乌'),

        '0851' => array('domain' => 'gy', 'name' => '贵阳'),
        '0858' => array('domain' => 'liupanshui', 'name' => '六盘水'),
        '0852' => array('domain' => 'zunyi', 'name' => '遵义'),
        '0853' => array('domain' => 'anshun', 'name' => '安顺'),
        '0856' => array('domain' => 'tongren', 'name' => '铜仁'),
        '0857' => array('domain' => 'bijie', 'name' => '毕节'),
        '0859' => array('domain' => 'qianxinan', 'name' => '黔西南'),
        '0855' => array('domain' => 'qiandongnan', 'name' => '黔东南'),
        '0854' => array('domain' => 'qiannan', 'name' => '黔南'),

        '028' => array('domain' => 'cd', 'name' => '成都'),
        '0813' => array('domain' => 'zigong', 'name' => '自贡'),
        '0830' => array('domain' => 'luzhou', 'name' => '泸州'),
        '0838' => array('domain' => 'deyang', 'name' => '德阳'),
        '0816' => array('domain' => 'mianyang', 'name' => '绵阳'),
        '0833' => array('domain' => 'leshan', 'name' => '乐山'),
        '0817' => array('domain' => 'nanchong', 'name' => '南充'),
        '0831' => array('domain' => 'yibin', 'name' => '宜宾'),
        '0818' => array('domain' => 'dazhou', 'name' => '达州'),
        '0834' => array('domain' => 'liangshan', 'name' => '凉山'),
        '0812' => array('domain' => 'panzhihua', 'name' => '攀枝花'),
        '0839' => array('domain' => 'guangyuan', 'name' => '广元'),
        '0825' => array('domain' => 'suining', 'name' => '遂宁'),
        '1832' => array('domain' => 'neijiang', 'name' => '内江'),
        '0826' => array('domain' => 'guangan', 'name' => '广安'),
        '1833' => array('domain' => 'meishan', 'name' => '眉山'),
        '0835' => array('domain' => 'yaan', 'name' => '雅安'),
        '0827' => array('domain' => 'bazhong', 'name' => '巴中'),
        '0832' => array('domain' => 'ziyang', 'name' => '资阳'),
        '0837' => array('domain' => 'aba', 'name' => '阿坝'),
        '0836' => array('domain' => 'ganzi', 'name' => '甘孜'),
        '028' => array('domain' => 'pixian', 'name' => '郫县'), // 郫都区
        '028' => array('domain' => 'shuangliu', 'name' => '双流'), // 双流区

        '024' => array('domain' => 'sy', 'name' => '沈阳'),
        '0411' => array('domain' => 'dl', 'name' => '大连'),
        '0412' => array('domain' => 'anshan', 'name' => '鞍山'),
        '0413' => array('domain' => 'fushun', 'name' => '抚顺'),
        '0415' => array('domain' => 'dandong', 'name' => '丹东'),
        '0416' => array('domain' => 'jinzhou', 'name' => '锦州'),
        '0417' => array('domain' => 'yingkou', 'name' => '营口'),
        '0419' => array('domain' => 'liaoyang', 'name' => '辽阳'),
        '0427' => array('domain' => 'panjin', 'name' => '盘锦'),
        '0429' => array('domain' => 'huludao', 'name' => '葫芦岛'),
        '0414' => array('domain' => 'benxi', 'name' => '本溪'),
        '0418' => array('domain' => 'fuxin', 'name' => '阜新'),
        '0410' => array('domain' => 'tieling', 'name' => '铁岭'),
        '0421' => array('domain' => 'chaoyang', 'name' => '朝阳市'),

        '025' => array('domain' => 'nj', 'name' => '南京'),
        '0510' => array('domain' => 'wx', 'name' => '无锡'),
        '0512' => array('domain' => 'su', 'name' => '苏州'),
        '0516' => array('domain' => 'xuzhou', 'name' => '徐州'),
        '0519' => array('domain' => 'changzhou', 'name' => '常州'),
        '0513' => array('domain' => 'nantong', 'name' => '南通'),
        '0518' => array('domain' => 'lianyungang', 'name' => '连云港'),
        '0517' => array('domain' => 'huaian', 'name' => '淮安'),
        '0515' => array('domain' => 'yancheng', 'name' => '盐城'),
        '0514' => array('domain' => 'yangzhou', 'name' => '扬州'),
        '0511' => array('domain' => 'zhenjiang', 'name' => '镇江'),
        '0523' => array('domain' => 'jstaizhou', 'name' => '泰州'),
        '0527' => array('domain' => 'suqian', 'name' => '宿迁'),
        '0512' => array('domain' => 'kunshan', 'name' => '昆山'),
        '0512' => array('domain' => 'changshu', 'name' => '常熟'),

        '0591' => array('domain' => 'fz', 'name' => '福州'),
        '0592' => array('domain' => 'xm', 'name' => '厦门'),
        '0594' => array('domain' => 'putian', 'name' => '莆田'),
        '0598' => array('domain' => 'sanming', 'name' => '三明'),
        '0595' => array('domain' => 'quanzhou', 'name' => '泉州'),
        '0596' => array('domain' => 'zhangzhou', 'name' => '漳州'),
        '0599' => array('domain' => 'nanping', 'name' => '南平'),
        '0597' => array('domain' => 'longyan', 'name' => '龙岩'),
        '0593' => array('domain' => 'ningde', 'name' => '宁德'),

        '0431' => array('domain' => 'cc', 'name' => '长春'),
        '0432' => array('domain' => 'jilin', 'name' => '吉林'),
        '0434' => array('domain' => 'siping', 'name' => '四平'),
        '0437' => array('domain' => 'liaoyuan', 'name' => '辽源'),
        '0435' => array('domain' => 'tonghua', 'name' => '通化'),
        '0439' => array('domain' => 'baishan', 'name' => '白山'),
        '0438' => array('domain' => 'songyuan', 'name' => '松原'),
        '0436' => array('domain' => 'baicheng', 'name' => '白城'),
        '1433' => array('domain' => 'yanbian', 'name' => '延边'),

        '0451' => array('domain' => 'hrb', 'name' => '哈尔滨'),
        '0452' => array('domain' => 'qiqihaer', 'name' => '齐齐哈尔'),
        '0467' => array('domain' => 'jixi', 'name' => '鸡西'),
        '0468' => array('domain' => 'hegang', 'name' => '鹤岗'),
        '0469' => array('domain' => 'shuangyashan', 'name' => '双鸭山'),
        '0459' => array('domain' => 'daqing', 'name' => '大庆'),
        '0458' => array('domain' => 'hljyichun', 'name' => '伊春'),
        '0454' => array('domain' => 'jiamusi', 'name' => '佳木斯'),
        '0456' => array('domain' => 'heihe', 'name' => '黑河'),
        '0455' => array('domain' => 'suihua', 'name' => '绥化'),
        '0464' => array('domain' => 'qitaihe', 'name' => '七台河'),
        '0453' => array('domain' => 'mudanjiang', 'name' => '牡丹江'),
        '0457' => array('domain' => 'daxinganling', 'name' => '大兴安岭'),

        '0371' => array('domain' => 'zz', 'name' => '郑州'),
        '0379' => array('domain' => 'luoyang', 'name' => '洛阳'),
        '0375' => array('domain' => 'pingdingshan', 'name' => '平顶山'),
        '0391' => array('domain' => 'jiaozuo', 'name' => '焦作'),
        '0392' => array('domain' => 'hebi', 'name' => '鹤壁'),
        '0373' => array('domain' => 'xinxiang', 'name' => '新乡'),
        '0372' => array('domain' => 'anyang', 'name' => '安阳'),
        '0395' => array('domain' => 'luohe', 'name' => '漯河'),
        '0377' => array('domain' => 'nanyang', 'name' => '南阳'),
        '1391' => array('domain' => 'jiyuan', 'name' => '济源'),
        '0378' => array('domain' => 'kaifeng', 'name' => '开封'),
        '0393' => array('domain' => 'puyang', 'name' => '濮阳'),
        '0374' => array('domain' => 'xuchang', 'name' => '许昌'),
        '0398' => array('domain' => 'sanmenxia', 'name' => '三门峡'),
        '0370' => array('domain' => 'shangqiu', 'name' => '商丘'),
        '0376' => array('domain' => 'xinyang', 'name' => '信阳'),
        '0394' => array('domain' => 'zhoukou', 'name' => '周口'),
        '0396' => array('domain' => 'zhumadian', 'name' => '驻马店'),

        '0531' => array('domain' => 'jn', 'name' => '济南'),
        '0532' => array('domain' => 'qd', 'name' => '青岛'),
        '0533' => array('domain' => 'zibo', 'name' => '淄博'),
        '0632' => array('domain' => 'zaozhuang', 'name' => '枣庄'),
        '0546' => array('domain' => 'dongying', 'name' => '东营'),
        '0535' => array('domain' => 'yantai', 'name' => '烟台'),
        '0536' => array('domain' => 'weifang', 'name' => '潍坊'),
        '0631' => array('domain' => 'wei', 'name' => '威海'),
        '0634' => array('domain' => 'laiwu', 'name' => '莱芜'),
        '0543' => array('domain' => 'binzhou', 'name' => '滨州'),
        '0537' => array('domain' => 'jining', 'name' => '济宁'),
        '0538' => array('domain' => 'taian', 'name' => '泰安'),
        '0633' => array('domain' => 'rizhao', 'name' => '日照'),
        '0539' => array('domain' => 'linyi', 'name' => '临沂'),
        '0534' => array('domain' => 'dezhou', 'name' => '德州'),
        '0635' => array('domain' => 'liaocheng', 'name' => '聊城'),
        '0530' => array('domain' => 'heze','name' => '菏泽'),
        '0532' => array('domain' => 'jiaozhou', 'name' => '胶州'),
        '0532' => array('domain' => 'jimo', 'name' => '即墨'),

        '0551' => array('domain' => 'hf', 'name' => '合肥'),
        '0553' => array('domain' => 'wuhu', 'name' => '芜湖'),
        '0552' => array('domain' => 'bengbu', 'name' => '蚌埠'),
        '0555' => array('domain' => 'maanshan', 'name' => '马鞍山'),
        '0556' => array('domain' => 'anqing', 'name' => '安庆'),
        '0550' => array('domain' => 'chuzhou', 'name' => '滁州'),
        '1558' => array('domain' => 'fuyang', 'name' => '阜阳'),
        '0557' => array('domain' => 'ahsuzhou', 'name' => '宿州'),
        '0551' => array('domain' => 'chaohu', 'name' => '巢湖'),
        '0564' => array('domain' => 'luan', 'name' => '六安'),
        '0554' => array('domain' => 'huainan', 'name' => '淮南'),
        '0561' => array('domain' => 'huaibei', 'name' => '淮北'),
        '0562' => array('domain' => 'tongling', 'name' => '铜陵'),
        '0559' => array('domain' => 'huangshan', 'name' => '黄山'),
        '0558' => array('domain' => 'bozhou', 'name' => '亳州'),
        '0566' => array('domain' => 'chizhou', 'name' => '池州'),
        '0563' => array('domain' => 'xuancheng', 'name' => '宣城'),

        '0771' => array('domain' => 'nn', 'name' => '南宁'),
        '0772' => array('domain' => 'liuzhou', 'name' => '柳州'),
        '0773' => array('domain' => 'gl', 'name' => '桂林'),
        '0774' => array('domain' => 'wuzhou', 'name' => '梧州'),
        '0777' => array('domain' => 'qinzhou', 'name' => '钦州'),
        '1755' => array('domain' => 'guigang', 'name' => '贵港'),
        '0775' => array('domain' => 'gxyulin', 'name' => '玉林'),
        '0776' => array('domain' => 'baise', 'name' => '百色'),
        '0778' => array('domain' => 'hechi', 'name' => '河池'),
        '1772' => array('domain' => 'laibin', 'name' => '来宾'),
        '0779' => array('domain' => 'beihai', 'name' => '北海'),
        '0770' => array('domain' => 'fangchenggang','name' => '防城港'),
        '1774' => array('domain' => 'hezhou','name' => '贺州'),
        '1771' => array('domain' => 'chongzuo','name' => '崇左'),

        '0898' => array('domain' => 'hn', 'name' => '海口'),
        '0899' => array('domain' => 'sanya', 'name' => '三亚'),
        '1897' => array('domain' => 'wuzhishan','name' => '五指山'),
        '1894' => array('domain' => 'qh', 'name' => '琼海'),
        '0805' => array('domain' => 'danzhou', 'name' => '儋州'),

        '0471' => array('domain' => 'nmg', 'name' => '呼和浩特'),
        '0472' => array('domain' => 'baotou', 'name' => '包头'),
        '0473' => array('domain' => 'wuhai', 'name' => '乌海'),
        '0476' => array('domain' => 'chifeng', 'name' => '赤峰'),
        '0475' => array('domain' => 'tongliao', 'name' => '通辽'),
        '0477' => array('domain' => 'eerduosi', 'name' => '鄂尔多斯'),
        '0470' => array('domain' => 'hulunbeier', 'name' => '呼伦贝尔'),
        '0478' => array('domain' => 'bayannaoer', 'name' => '巴彦淖尔'),
        '0474' => array('domain' => 'wulanchabu', 'name' => '乌兰察布'),
        '0482' => array('domain' => 'xingan', 'name' => '兴安盟'),
        '0479' => array('domain' => 'xilinguole','name' => '锡林郭勒'),
        '0483' => array('domain' => 'alashan','name' => '阿拉善'),

        '0351' => array('domain' => 'ty', 'name' => '太原'),
        '0352' => array('domain' => 'datong', 'name' => '大同'),
        '0353' => array('domain' => 'yangquan', 'name' => '阳泉'),
        '0355' => array('domain' => 'changzhi', 'name' => '长治'),
        '0356' => array('domain' => 'jincheng', 'name' => '晋城'),
        '0349' => array('domain' => 'shuozhou', 'name' => '朔州'),
        '0354' => array('domain' => 'jinzhong', 'name' => '晋中'),
        '0359' => array('domain' => 'yuncheng', 'name' => '运城'),
        '0350' => array('domain' => 'xinzhou', 'name' => '忻州'),
        '0357' => array('domain' => 'linfen', 'name' => '临汾'),
        '0358' => array('domain' => 'lvliang','name' => '吕梁'),

        '0951' => array('domain' => 'yc', 'name' => '银川'),
        '0952' => array('domain' => 'shizuishan','name' => '石嘴山'),
        '0953' => array('domain' => 'wuzhong','name' => '吴忠'),
        '0954' => array('domain' => 'guyuan','name' => '固原'),
        '1953' => array('domain' => 'zhongwei','name' => '中卫'),

        '0931' => array('domain' => 'lz', 'name' => '兰州'),
        '0935' => array('domain' => 'jinchang', 'name' => '金昌'),
        '0943' => array('domain' => 'baiyin', 'name' => '白银'),
        '0938' => array('domain' => 'tianshui', 'name' => '天水'),
        '1935' => array('domain' => 'wuwei', 'name' => '武威'),
        '0936' => array('domain' => 'zhangye', 'name' => '张掖'),
        '0933' => array('domain' => 'pingliang', 'name' => '平凉'),
        '0937' => array('domain' => 'jiuquan', 'name' => '酒泉'),
        '0934' => array('domain' => 'qingyang', 'name' => '庆阳'),
        '0932' => array('domain' => 'dingxi', 'name' => '定西'),
        '2935' => array('domain' => 'longnan','name' => '陇南'),
        '0930' => array('domain' => 'linxia','name' => '临夏'),
        '0941' => array('domain' => 'gannan','name' => '甘南'),
        '1937' => array('domain' => 'jiayuguan','name' => '嘉峪关'),

        '0437' => array('domain' => 'xa', 'name' => '西安'),
        '0919' => array('domain' => 'tongchuan', 'name' => '铜川'),
        '0917' => array('domain' => 'baoji', 'name' => '宝鸡'),
        '0910' => array('domain' => 'xianyang', 'name' => '咸阳'),
        '0913' => array('domain' => 'weinan', 'name' => '渭南'),
        '0911' => array('domain' => 'yanan', 'name' => '延安'),
        '0916' => array('domain' => 'hanzhong', 'name' => '汉中'),
        '0912' => array('domain' => 'sxyulin', 'name' => '榆林'),
        '0915' => array('domain' => 'ankang', 'name' => '安康'),
        '0914' => array('domain' => 'shangluo', 'name' => '商洛'),

        '0971' => array('domain' => 'xn', 'name' => '西宁'),
        '0972' => array('domain' => 'haidong', 'name' => '海东'),
        '0970' => array('domain' => 'haibei', 'name' => '海北'),
        '0973' => array('domain' => 'huangnan', 'name' => '黄南'),
        '0974' => array('domain' => 'hainanzhou', 'name' => '海南州'), // 海南藏族自治州
        '0975' => array('domain' => 'guoluo', 'name' => '果洛'),
        '0976' => array('domain' => 'yushu', 'name' => '玉树'),
        '0977' => array('domain' => 'haixi', 'name' => '海西'),

        '027' => array('domain' => 'wh', 'name' => '武汉'),
        '0714' => array('domain' => 'huangshi', 'name' => '黄石'),
        '0710' => array('domain' => 'xiangyang', 'name' => '襄阳'),
        '0719' => array('domain' => 'shiyan', 'name' => '十堰'),
        '0716' => array('domain' => 'jingzhou', 'name' => '荆州'),
        '0717' => array('domain' => 'yichang', 'name' => '宜昌'),
        '0724' => array('domain' => 'jingmen', 'name' => '荆门'),
        '0711' => array('domain' => 'ezhou', 'name' => '鄂州'),
        '0728' => array('domain' => 'xiantao', 'name' => '仙桃'),
        '2728' => array('domain' => 'qianjiang', 'name' => '潜江'),
        '0712' => array('domain' => 'xiaogan','name' => '孝感'),
        '0713' => array('domain' => 'huanggang','name' => '黄冈'),
        '0715' => array('domain' => 'xianning','name' => '咸宁'),
        '0722' => array('domain' => 'suizhou','name' => '随州'),
        '0718' => array('domain' => 'enshi','name' => '恩施'),
        '1728' => array('domain' => 'tianmen','name' => '天门'),
        '1719' => array('domain' => 'shennongjia','name' => '神农架'),

        '0731' => array('domain' => 'cs', 'name' => '长沙'),
        '0733' => array('domain' => 'zhuzhou', 'name' => '株洲'),
        '0732' => array('domain' => 'xiangtan', 'name' => '湘潭'),
        '0734' => array('domain' => 'hengyang', 'name' => '衡阳'),
        '0739' => array('domain' => 'shaoyang', 'name' => '邵阳'),
        '0730' => array('domain' => 'yueyang', 'name' => '岳阳'),
        '0736' => array('domain' => 'changde', 'name' => '常德'),
        '0735' => array('domain' => 'chenzhou', 'name' => '郴州'),
        '0746' => array('domain' => 'yongzhou', 'name' => '永州'),
        '0738' => array('domain' => 'loudi', 'name' => '娄底'),
        '0744' => array('domain' => 'zhangjiajie','name' => '张家界'),
        '0737' => array('domain' => 'yiyang','name' => '益阳'),
        '0745' => array('domain' => 'huaihua','name' => '怀化'),
        '0743' => array('domain' => 'xiangxi','name' => '湘西'),

        '0791' => array('domain' => 'nc', 'name' => '南昌'),
        '0798' => array('domain' => 'jingdezhen', 'name' => '景德镇'),
        '0799' => array('domain' => 'pingxiang', 'name' => '萍乡'),
        '0792' => array('domain' => 'jiujiang', 'name' => '九江'),
        '0790' => array('domain' => 'xinyu', 'name' => '新余'),
        '0701' => array('domain' => 'yingtan', 'name' => '鹰潭'),
        '0797' => array('domain' => 'ganzhou', 'name' => '赣州'),
        '0796' => array('domain' => 'jian', 'name' => '吉安'),
        '0795' => array('domain' => 'jxyichun', 'name' => '宜春'),
        '0794' => array('domain' => 'jxfuzhou', 'name' => '抚州'),
        '0793' => array('domain' => 'shangrao', 'name' => '上饶'),

        '0871' => array('domain' => 'km', 'name' => '昆明'),
        '0874' => array('domain' => 'qujing', 'name' => '曲靖'),
        '0877' => array('domain' => 'yuxi', 'name' => '玉溪'),
        '0875' => array('domain' => 'baoshan', 'name' => '保山'),
        '0870' => array('domain' => 'zhaotong', 'name' => '昭通'),
        '0888' => array('domain' => 'lijiang', 'name' => '丽江'),
        '0879' => array('domain' => 'puer', 'name' => '普洱'),
        '0883' => array('domain' => 'lincang', 'name' => '临沧'),
        '0876' => array('domain' => 'wenshan', 'name' => '文山'),
        '0873' => array('domain' => 'honghe', 'name' => '红河'),
        '0691' => array('domain' => 'xishuangbanna', 'name' => '西双版纳'),
        '0878' => array('domain' => 'chuxiong', 'name' => '楚雄'),
        '0872' => array('domain' => 'dali', 'name' => '大理'),
        '0692' => array('domain' => 'dehong', 'name' => '德宏'),
        '0886' => array('domain' => 'nujiang', 'name' => '怒江'),
        '0887' => array('domain' => 'diqing', 'name' => '迪庆'),

        '0991' => array('domain' => 'xj', 'name' => '乌鲁木齐'),
        '0990' => array('domain' => 'kelamayi', 'name' => '克拉玛依'),
        '0995' => array('domain' => 'tulufan', 'name' => '吐鲁番'),
        '0902' => array('domain' => 'hami', 'name' => '哈密'),
        '0903' => array('domain' => 'hetian', 'name' => '和田'),
        '0997' => array('domain' => 'akesu', 'name' => '阿克苏'),
        '0998' => array('domain' => 'kashi', 'name' => '喀什'),
        '0908' => array('domain' => 'kezilesu', 'name' => '克孜勒苏'),
        '0996' => array('domain' => 'bayinguoleng', 'name' => '巴音郭楞'),
        '0994' => array('domain' => 'changji', 'name' => '昌吉'),
        '0909' => array('domain' => 'boertala', 'name' => '博尔塔拉'),
        '0999' => array('domain' => 'yili', 'name' => '伊犁'),
        '0901' => array('domain' => 'tacheng', 'name' => '塔城'),
        '0906' => array('domain' => 'aletai', 'name' => '阿勒泰'),
        '0993' => array('domain' => 'shihezi', 'name' => '石河子'),
        '0996' => array('domain' => 'kuerle','name' => '库尔勒'),
        '1997' => array('domain' => 'alaer', 'name' => '阿拉尔'),
        '1998' => array('domain' => 'tumushuke', 'name' => '图木舒克'),
        '1994' => array('domain' => 'wujiaqu', 'name' => '五家渠'),

        '0891' => array('domain' => 'xz', 'name' => '拉萨'),
        '0895' => array('domain' => 'changdu', 'name' => '昌都'),
        '0893' => array('domain' => 'shannan', 'name' => '山南'),
        '0892' => array('domain' => 'rikaze', 'name' => '日喀则'),
        '0896' => array('domain' => 'naqu', 'name' => '那曲'),
        '0897' => array('domain' => 'ali', 'name' => '阿里'),
        '0894' => array('domain' => 'linzhi', 'name' => '林芝'),

        '1852' => array('domain' => 'xianggang','name' => '香港'),
        '1853' => array('domain' => 'aomen','name' => '澳门'),
    );
}